package com.jiazhong.常用类.String;

//1、从字符串“abcdefzhig”中取下标为偶数的字符放入另一字符串中，并输出。（用两种方法完成：①、用字符数组来完成。②、用字符串来完成。）
public class Text01 {
    public static void main(String[] args) {
        String str = new String("abcdefzhig");
        for (int i = 0; i < str.length(); i = i + 2) {
            char c = str.charAt(i);
            System.out.print(" "+c);
        }
//        String  a[]={"a","b","c","d","e","f","z","h","i","g"};
//        for (int i = 0; i < a.length; i = i + 2) {
//            String c = a[i];
//            System.out.println(c);
//        }
    }
}
